package top.jle.wx.proxy.domain.templateMsg;


import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import org.apache.commons.lang3.StringUtils;

@Schema(title="跳转到关联小程序的模板消息请求体")
@Getter
@Setter
public  class ToMiniprogramMessageOption extends TemplateMessage{

    private Miniprogram miniprogram;

    @Override
    public boolean valid() {
        return super.valid() && this.miniprogram!=null && this.miniprogram.valid();
    }

    @Schema(title="小程序信息")
    @Getter
    @Setter
    static class Miniprogram{
        @Schema(title="小程序appid")
        private String appid;
        @Schema(title="跳转到小程序的页面")
        private String path;
        public boolean valid(){
            return StringUtils.isNotBlank(this.appid) && StringUtils.isNotBlank(this.path);
        }
    }

}

